(function($) {
/*whatever jQuery stuff*/
	$(function(){
		$('#musicSearchText').keypress(function(event){
			if(event.keyCode == 13){
				var txtSearch = $.trim($(this).val());
				if(txtSearch != ""){
					music_search(txtSearch);
				}
				return false;
			}			
		});
	});
})(jQuery);

/*Music Search*/
function music_search(txt)
{
	if(txt.trim() != ""){
		window.location.href = 'http://music.you2play.com/search?text='+txt;
	}
}

/*Vote Song*/
function voteSong(e,song_id,score){
	$.ajax({
		type:'post',
		url:web_path+'ajax_vote_song',
		data:({
			song_id:song_id,
			score:score
		}),
		dataType:'json',
		async:false
	}).done(function(data){
		alert(data.msg);
		if(data.avg != '' && data.people != ''){
			$(e).parent().find('.voteAvg').html(data.avg);
			$(e).parent().find('.votePeople').html(data.people);
		}
	});
}